update prometheus metric labels to constants#4797
update prometheus metric labels to constants#4797tylerauerbeck wants to merge 2 commits intoarmadaproject:masterfrom
Conversation
Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
Greptile SummaryThis PR refactors Key observations:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Label Constants Block<br/>labelPool, labelQueue, labelCluster, ...] -->|used in| B[Prometheus Desc Variables<br/>QueueAllocatedDesc, ClusterCapacityDesc, ...]
B -->|registered via| C[AllDescs slice]
C -->|iterated in| D[Describe func]
B -->|referenced by| E[New* metric constructor funcs<br/>e.g. NewQueueAllocated, NewClusterCapacity]
E -->|emit| F[Prometheus Metrics]
|
b7f8d85 to
75fc495
Compare
Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
What type of PR is this?
What this PR does / why we need it
Updates prometheus labels to be constants instead of strings. This improves code quality and makes it less likely for future develops to mistakenly create new metrics in the future by introducing typos.
Which issue(s) this PR fixes
Fixes #4777
Special notes for your reviewer